﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Silverlight.ControlToolkit.Validator
{
    public class ValidatorEventArgs : RoutedEventArgs
    {
        public bool IsValid { get; set; }
        public string ErrorMessage { get; set; }
        public Control TargetControl { get; set; }

        public ValidatorEventArgs(Control targetControl)
        {
            this.TargetControl = targetControl;
            this.IsValid = true;
            this.ErrorMessage = string.Empty;
        }

        public ValidatorEventArgs(Control targetControl, bool isValid, string errorMessage)
        {
            this.TargetControl = targetControl;
            this.IsValid = IsValid;
            this.ErrorMessage = errorMessage;
        }
    
    }

    public class ValidatingEventArgs : ValidatorEventArgs
    {
        public ValidatingEventArgs(Control targetControl)
            : base(targetControl)
        { 
        }

        public ValidatingEventArgs(Control targetControl, bool isValid, string errorMessage)
            : base(targetControl, isValid, errorMessage)
        {
        }
    
    }

    public class ValidatedEventArgs : ValidatorEventArgs
    {
        public ValidatedEventArgs(Control targetControl)
            : base(targetControl)
        { 
        }

        public ValidatedEventArgs(Control targetControl, bool isValid, string errorMessage)
            : base(targetControl, isValid, errorMessage)
        {
        }
    }


    public delegate void ValidatingEventHandler(object sender, ValidatingEventArgs e);
    public delegate void ValidatedEventHandler(object sender, ValidatedEventArgs e);


}
